/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   ft_sqrt.c                                          :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: phella <marvin@42.fr>                      +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2021/06/30 18:14:42 by phella            #+#    #+#             */
/*   Updated: 2021/06/30 19:00:45 by phella           ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

int	ft_sqrt(int	nb)
{
	int	a;

	a = 0;
	if (nb <= 0)
		return (0);
	else
		while (a * a < nb)
			a++;
	if (a * a == nb)
		return (a);
	else
		return (0);
}
